package model

import (
	"gorm.io/gorm"
	"time"
)

type Goods struct {
	Id          uint32         `gorm:"column:id;type:int UNSIGNED;primaryKey;not null;" json:"id"`
	UserId      uint32         `gorm:"column:user_id;type:int UNSIGNED;not null;" json:"user_id"`
	GoodsName   string         `gorm:"column:goods_name;type:varchar(30);not null;" json:"goods_name"`
	GoodsTitle  string         `gorm:"column:goods_title;type:varchar(50);not null;" json:"goods_title"`
	GoodsImages string         `gorm:"column:goods_images;type:varchar(255);not null;" json:"goods_images"`
	GoodsInfo   string         `gorm:"column:goods_info;type:varchar(255);not null;" json:"goods_info"`
	Price       float64        `gorm:"column:price;type:decimal(10, 2);not null;" json:"price"`
	CreatedAt   time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt   time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt   gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}
